home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 4140 < prev    next >
Encoding:
Text File  |  1996-08-06  |  1.2 KB  |  40 lines

  1. Newsgroups: comp.os.ms-windows.programmer.tools.mfc,comp.os.ms-windows.apps.compatibility.win95,comp.lang.c++
  2. Path: king.mcs.drexel.edu!urcrawfo
  3. From: urcrawfo@mcs.drexel.edu (Programmer)
  4. Subject: Re: HELP !!! Memory - Allocation
  5. Message-ID: <1996Jan28.015441.7082@mcs.drexel.edu>
  6. Followup-To: comp.os.ms-windows.programmer.tools.mfc,comp.os.ms-windows.apps.compatibility.win95,comp.lang.c++
  7. Organization: Drexel University, Dept. of Math. and Comp. Sci.
  8. X-Newsreader: TIN [version 1.2 PL2]
  9. References: <NEWTNews.751.822443462.Postmaster@Jerusalem.netvision.net.il>
  10. Date: Sun, 28 Jan 96 01:54:41 GMT
  11.  
  12. iti@Jerusalem.netvision.net.il wrote:
  13.  
  14.  
  15. : I am using Visual C++ to write a Windows Application - and I am having
  16. : a memory problem. I want to dynamically allocate "nTemp" bytes of memory
  17. : to read in a char string, or the most memory available up to "nTemp" 
  18. : bytes.  
  19.  
  20. : My questions being:
  21. :     1. How can I most efficiantly do this?
  22. :     2. Should I use 
  23. :             -> pChar = (char*) malloc(nTemp); Or
  24. :             -> pChar = new char[nTemp];
  25.  
  26. : Please send any advice you have for me to my EMail address:
  27. :     iti@netvision.net.il
  28.  
  29. : Thanks
  30. : Yaakov
  31.  
  32. Hello:
  33.  
  34. It is highly recommended using the "new" operator when using C++.
  35. It is both practical and effifienct.
  36.  
  37.  
  38. Ronski
  39.  
  40.